function create_zsk_view(){
	// get_data_and_append("/index.php/tasktree/getzsk/","#zsk_view",10,'zsk');
    var op={
        dataurl:"/index.php/tasktree/getzsk/",
        // dom:"#zsk_view",
		// 如果挂装到view下，那要取得根节点，要修改上述网址
        dom:"#910",
        taskid:10,
        task_dom_type:"zsk",
		noroot:true
    }
	get_data_and_append(op);
}

function create_zsk_page(){
	// get_data_and_append("/index.php/tasktree/getzsk/","#zsk_view",10,'zsk');
}


function new_task_zsk(item,nodivend=0){

	// 生成task的起始html标签<div ...>
	var new_dom_id = unique_dom_id++;
//	console.log(new_dom_id);
	var htmlstr='<div  data-taskid="'+item.id+'" ';
	htmlstr+=' class="task  zsk" id="'+new_dom_id+'"'
		+' draggable="true" ondragstart="task_dragstart(event)" ';//仅有正常节点才能被拖放
	htmlstr=htmlstr
	+' data-sort="'+item.sort+'"'
	+' data-stage="'+item.stage+'"'
	+' data-active="'+item.active+'"'
	+' data-parent="'+item.parent+'"'
	+' data-archive="'+item.archive+'"'
	+' data-nodetype="'+item.getway+'"'
	+' data-intags="'+item.intags+'"'
	+' data-tags="'+item.tags+'"'
	+' data-haschild="'+item.haschild+'"'
	+' data-team="'+item.tid+'"'
    +' data-set="'+item.set+'"'
    +' data-nodetype="'+item.nodetype+'"'
	+' data-simple="'+item.simple+'"';
	if(!item.nodetype){
//		htmlstr+='  ondrop="task_drop(event)" ';
	}
	htmlstr+='>';
//	console.log(htmlstr);

	// 生成task标题头部分
	htmlstr+=new_task_header_zsk(item);


	// 生成标题尾部分，这里根据参数nodivend，来决定是否包含</div>结束符，还是依赖调用程序来收尾，因为调用程序有时要在这里插入子节点
	if(!nodivend){
		htmlstr += '</div>';
	}

	return htmlstr;
}

function new_task_header_zsk(item){//用push代替+=，以提高性能
	var buf = [];
	// buf.push('<span class="right_btn"><a><i class="fa fa-angle-up"></i></a><a><i class="fa fa-angle-down"></i></a><a><i class="fa fa-angle-right"></i></a></span>');
	// buf.push('<a class="expend_fold" href="###" title="展开"><i  class="fa fa-folder-o"></i></a>');

	buf.push('<a class="expend_fold" href="###" title="展开"><i  class="fa fa-folder-o"></i></a>'
	+'<span class="task_title task_for_drag " title="'+String(item.in_date)+'">'+item.title+'</span>');
	
	// if(item.link){
	// 	r=item.link.match(/http[s]?\:\/\/([^\/]*)/);
	// 	if(r){
	// 		buf.push('<a class="task_link" href="'+item.link+'" target="_blank" title="外链" ><img  class="fa fa-link" src="'+r[0]+'/favicon.ico'+'" onerror="this.src=\'/_assets/icons/link.svg\';"></a>');
	// 	}else{
	// 		buf.push('<a class="task_link" href="'+item.link+'" target="_blank" title="外链"><i class="fa fa-link"></i></a>');			
	// 	}
	// }else{
	// 	// buf.push('<a class="task_link"></a>');
	// }

	// buf.push('<br>');
	// buf.push('<a class="" href="'+item.link+'" target="_blank" title="">'
	// +'<span class="task_title task_for_drag " title="'+String(item.in_date)+'">'+item.title+'</span>'
	// +'</a>'
	// );
	
	// buf.push('<a class="stage_icon"><i></i></a>');//使用样式表图形文件图标
	// buf.push('<span class="start_date">' + (item.start_date?String(item.start_date).substring(5,10):'') + '</span>');
	buf.push('<span class="tags">'+(item.tags?tags_split_html(String(item.tags)):'')+'</span>');
	// buf.push('<span class="iconbar">'+(item.intags?style_tags_split_html(String(item.intags)):'')+'</span>');
	buf.push((item.internal_link>0)
				?'<a class="task_internal_link" href="###" data-internal_link="'+item.internal_link+'" title="关联到其它任务"><i class="fa fa-share-square" onclick="position_task_id('+item.internal_link+')"></i></a>'
				:'<a class="task_internal_link"></a>'
			);

	
	if(item.photo){
		buf.push('<a class="task_photo_icon" href="###" title="图片" data-url="'+item.photo+'"><i class="fa fa-photo"></i></a>');
	}else{
		buf.push('<a class="task_photo_icon"></a>');
	}
	// 注释
	if(item.comment){
		buf.push('<a class="task_comment_icon" href="###"  title="备注"><i class="fa fa-comment"></i></a>');
	}else{
		buf.push('<a class="task_comment_icon"></a>');
		item.comment='';
	}
//	buf.push('<a class="un_active"><i class="fa fa-indent"></i></a>');
	// buf.push('<a class="magic_icon" href="###"><i ></i></a>');
    // buf.push('<span class="profile_photo"></span>');
	buf.push('<a class="icon_button btn_for_toolbar"  href="###"  title="操作面板'+item.id+'"><i  class="fa fa-lg fa-angle-double-right"></i></a>');
	buf.push('<div class="task_comment radius" ><span><i class="fa fa-check btn" onclick="change_comment(event);"></i><i class="fa fa-remove btn " ></i></span><textarea>'+item.comment+'</textarea></div>');
	// 	//	console.dir(buf);
	return  '<div class="task_head">' + buf.join('') + '</div>';
}

$(document).ready(function() {

		 
});	//end of $(document).ready事件